package org.flown.text;


public class StringUtil
{
    public static String toUnderline(String str)
    {
        StringBuilder builder = new StringBuilder(str.replaceAll("[A-Z]", "_$0").toLowerCase());
        if (Character.isUpperCase(str.charAt(0)))//若首字母大写则
            builder.deleteCharAt(0);//去掉下划线
        return builder.toString();
    }
    
}
